<include file="Public/head"/>
<body class="no-skin">
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <!-- /section:settings.box -->

                <div class="row">

                    <a onclick="document.location.reload()" class="btn btn-purple btn-sm">
                        <span class="ace-icon fa fa-globe  icon-on-right bigger-110"></span>
                        刷新数据
                    </a>

                    <a href="{:U('initAccount')}" class="btn btn-warning btn-sm">
                        初始化
                    </a>
                    <a href="{:U('add')}" class="btn btn-grey btn-sm">
                        创建账号
                    </a>

                </div>

                <div class="row">
                    <div class="col-xs-12">

                        <div class="space-4"></div>
                        <div class="row">
                            <form id="form" method="post" action="{:U('del')}">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <!--<th class="center"><input class="check-all" type="checkbox" value=""></th>-->
                                        <th class="center">ID</th>
                                        <th class="center">账号</th>
                                        <th class="center">当天使用次数</th>
                                        <th class="center">状态</th>
                                        <th class="center">备注</th>
                                        <th class="center">使用中或关闭客服</th>
                                        <th class="center">操作</th>
                                    </tr>
                                    </thead>
                                    <volist name="accountList" id="val">

                                        <tr
                                        <if condition="$val[status] eq 2"> style="background-color:#f9b3b3;"</if>
                                        >
                                        <td class="center">{$val.id}</td>
                                        <td class="center">{$val.account}</td>
                                        <td class="center">{$val.count}</td>
                                        <td class="center">
                                            <if condition="$val[status] == 1 ">
                                                正常
                                                <else/>
                                                使用中
                                            </if>

                                        </td>
                                        <td class="center">{$val.remark}</td>
                                        <td class="center">{$val.user}</td>
                                        <td class="center">


                                            <a href="{:U('edit', array('id'=>$val[id]))}"
                                               class="btn btn-xs " type="button">编辑</a>

                                            <if condition="$val[count] gt 0 ">

                                                <if condition="$val[status] == 1 ">
                                                    <a class="btn btn-xs btn-pink"
                                                       href="{:U('openAccount', array('id'=>$val[id]))}"> 使用</a>
                                                    <else/>
                                                    <a class="btn btn-xs btn-primary"
                                                       href="{:U('closeAccount', array('id'=>$val[id]))}"> 使用完毕</a>
                                                </if>
                                            </if>
                                        </td>
                                        </tr>
                                    </volist>


                                    </tbody>
                                </table>
                            </form>

                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->


<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script src="__PUBLIC__/qwadmin/js/function.js"></script>
<script type="text/javascript">
    jQuery(function ($) {
        $('.dates').datepicker({
            format: 'yyyy-mm-dd',
            weekStart: 1,
            autoclose: true,
            todayBtn: 'linked',
            language: 'cn'
        });
    });
</script>


</body>
</html>
